﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Share/Default.master" AutoEventWireup="true" CodeFile="ArticleEdit.aspx.cs" Inherits="Admin_Article_ArticleEdit" Title="无标题页" %>

<%@ Register Assembly="mybutton" Namespace="BlogLan.Web.Controls" TagPrefix="cc1" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">

    <script type="text/javascript">
    var oEditer;
    function CustomValidate(source, arguments) {
        var value = oEditer.GetXHTML(true);
        if (value == "") {
            arguments.IsValid = false;
        }
        else {
            arguments.IsValid = true;
        }
    }

    function FCKeditor_OnComplete(editorInstance) {
        oEditer = editorInstance;
    }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="Server">
    <center><asp:Localize ID="errors" runat="server"></asp:Localize></center>
    <table width="80%">
        <tr>
            <td style="width: 60px">
                文章标题
            </td>
            <td>
                <asp:TextBox ID="newstitle" runat="server" MaxLength="100"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rvtitle" runat="server" ControlToValidate="newstitle"
                    ErrorMessage="填写标题"> </asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                文章副标题
            </td>
            <td>
                <asp:TextBox ID="subhead" runat="server" MaxLength="200"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rvsubhead" runat="server" ControlToValidate="subhead"
                    ErrorMessage="填写文章副标题"> </asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                文章作者
            </td>
            <td>
                <asp:TextBox ID="author" runat="server" MaxLength="10"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rvauthor" runat="server" ControlToValidate="author"
                    ErrorMessage="填写文章作者"> </asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                文章小图
            </td>
            <td>
                <asp:FileUpload ID="smallImg" runat="server" />
            </td>
        </tr>
        <tr>
            <td>
                所属分类
            </td>
            <td>
                <asp:DropDownList ID="category" runat="server">
                    <asp:ListItem Value="1" Text="帮助"></asp:ListItem>
                </asp:DropDownList>
                <asp:CompareValidator ID="cvtype" runat="server" ControlToValidate="category" ValueToCompare="-1"
                    Operator="NotEqual" ErrorMessage="选择文章所属分类"></asp:CompareValidator>
            </td>
        </tr>
        <tr>
            <td>
                文章权重
            </td>
            <td>
                <asp:TextBox ID="weight" runat="server" Text="0"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rvweight" runat="server" ControlToValidate="weight"
                    ErrorMessage="填写文章权重"> </asp:RequiredFieldValidator>
                <asp:CompareValidator ID="cvweight" runat="server" ControlToValidate="weight" Operator="DataTypeCheck"
                    ErrorMessage="权重必须为整数" Type="Integer"></asp:CompareValidator>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                文章正文<hr />
            </td>
            <tr>
                <td colspan="2">
                    <FCKeditorV2:FCKeditor ID="content" runat="server" ToolbarSet="MyDesign" Height="360">
                    </FCKeditorV2:FCKeditor>
                    <asp:CustomValidator Display="Dynamic" ID="cvContent" runat="server" ControlToValidate="content"
                        ValidateEmptyText="true" ErrorMessage="请填写文章正文!" ClientValidationFunction="CustomValidate"></asp:CustomValidator>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <cc1:clickoncebutton id="save" text="保存" aftersubmittext="保存中..." runat="server"
                        onclick="save_Click" />
                    &nbsp;<cc1:clickoncebutton id="cancel" text="取消" aftersubmittext="保存中..." runat="server"
                        onclick="cancel_Click" />
                </td>
            </tr>
    </table>
    <%--编辑文章时,倘若有小图,保存小图地址,避免重复上传图片--%>
    <asp:HiddenField ID="hd_smallImg" runat="server" Value="" />
</asp:Content>


